package cn.zcy.service.impl;

import cn.zcy.domain.User;
import cn.zcy.service.UserService;
import org.springframework.aop.framework.AopContext;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class UserServiceImpl implements UserService {
    @Override
    public void save(User user) {

//            Thread.sleep(2000);
            int i= 1/0;
            System.out.println("保存了用户= " + user);

    }

    /**
     * 模拟查询用户
     * @param
     * @return
     */
    @Override
   public User findById(){
        User user =new User();
        user.setId(1);
        user.setUsername("张三");
        user.setAge(18);
        user.setSex('男');
        user.setBirthday(new Date());
        user.setPhone("1358421223");
        user.setEmail("516021118@qq.com");
//        int i=1/0;
        System.out.println("user = " + user);
        return user;
    }
}
